package com.zttek.videoShareProject.common.json;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.zttek.videoShareProject.modules.model.User;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Created by ZYZ on 2018/7/10
 */
public class UserJson {



    private Long userId;
    private String account;
    private String password;
    private Integer status;
    /**
     * 积分
     */
    private Integer score;
    private String email;
    private String telephone;
    /**
     * 0,1
     */
    private String sex;
    /**
     * 头像
     */

    private String imageUrl;
    /**
     * 0,1
     */

    private String userType;

    private String createDate;
    public UserJson(User user){
        this.userId=user.getUserId();
        this.account=user.getAccount();
        this.password=user.getPassword();
        this.status=user.getStatus();
        this.score=user.getScore();
        this.email=user.getEmail();
        this.telephone=user.getTelephone();
        this.sex=user.getSex()==0?"male":"female";
        this.userType=user.getUserType()==0?"管理员":"普通用户";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
        this.createDate=sdf.format(user.getCreateDate());
    }


    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }




    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", account=" + account +
                ", password=" + password +
                ", status=" + status +
                ", score=" + score +
                ", email=" + email +
                ", telephone=" + telephone +
                ", sex=" + sex +
                ", imageUrl=" + imageUrl +
                ", userType=" + userType +
                ", createDate=" + createDate +
                "}";
    }
}
